﻿using System;
using Dexter.Domain.Model;
using Dexter.Domain.Results;

namespace Dexter.Repository {
	/// <summary>
	/// 	Rapresents a repository of <see cref="InboxMessage"/>.
	/// </summary>
	public interface IInboxRepository : IRepository<InboxMessage> {
		/// <summary>
		/// Deletes the specified <see cref="InboxMessage"/> from the repository.
		/// </summary>
		/// <param name="item">The inbox message.</param>
		/// <exception cref="ArgumentNullException">If <paramref name="item"/> is <c>null</c>.</exception>
		void Delete ( InboxMessage item );

		/// <summary>
		/// 	Saves the specified <see cref="InboxMessage"/> into the repository.
		/// </summary>
		/// <param name="item">The inbox message.</param>
		/// <exception cref="ArgumentNullException">If <paramref name="item"/> is <c>null</c>.</exception>
		void Save ( InboxMessage item );

		///<summary>
		///	Return a list of <see cref="InboxMessage"/> sorted by creation date.
		///</summary>
		///<param name = "pageIndex">Index of the page (0 based).</param>
		///<param name = "pageSize">The number of items to retrieve.</param>
		/// <param name = "enableTracking">if set to <c>true</c> the tracking system of the return object will be enable.</param>
		///<returns>An concrete implementation of <see cref="IPagedResult"/>. The result will never be null.</returns>
		///<exception cref="ArgumentOutOfRangeException"> If <paramref name="pageIndex"/> is lesser than 0.</exception>
		///<exception cref="ArgumentOutOfRangeException"> If <paramref name="pageSize"/> is lesser than 1.</exception>
		IPagedResult<InboxMessage> GetList ( int pageIndex, int pageSize, bool enableTracking );
	}
}
